package com.imu.purse.modules.trade.form;

import com.alibaba.fastjson.annotation.JSONField;
import com.imu.common.validator.group.AddGroup;
import com.imu.common.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import java.math.BigDecimal;

@Data
public class YmbChargeForm {
    @JSONField(ordinal = 1)
    @ApiModelProperty(value = "充值金额", name="money", required = true, example="1")
    @NotNull(message="充值金额", groups = {AddGroup.class, UpdateGroup.class})
    private BigDecimal money;

    @JSONField(ordinal = 3)
    @ApiModelProperty(value = "用户ID", name="userId", required = true, example="备注")
    @NotNull(message="用户ID不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Min(value = 1, message="用户ID不存在", groups = {AddGroup.class, UpdateGroup.class})
    private Long userId;
    
    @JSONField(ordinal = 4)
    @ApiModelProperty(value = "手机号", name="phone", required = true, example="手机号")
    @NotBlank(message="手机号不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Length(max = 32, message="手机号过长", groups = {AddGroup.class, UpdateGroup.class})
    private String phone;

    @JSONField(ordinal = 2)
    @ApiModelProperty(value = "原因", name="description", required = true, example="原因")
    @NotBlank(message="原因不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Length(max = 500, message="原因信息过长", groups = {AddGroup.class, UpdateGroup.class})
    private String description;
}
